import 'package:dss_base/utils/navigator_util.dart';
import 'package:dss_base/widgets/basis/container_x.dart';
import 'package:dss_base/widgets/basis/image_x.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ImageBack extends StatelessWidget {
  const ImageBack({super.key, this.isBlack = true, this.onPressed, this.padding});

  final bool isBlack;

  final EdgeInsetsGeometry? padding;
  final GestureTapCallback? onPressed;

  @override
  Widget build(BuildContext context) {
    return ImageX(
      urlOrPath: isBlack ? 'dss_base/ic_back_black.png' : 'dss_base/ic_back_white.png',
      padding: padding ?? EdgeInsets.all(16.w),
      width: 18.w,
      height: 18.w,
      onPressed: onPressed ?? (){
        NavigatorUtil.back();
      },
    );
  }
}
